import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)



import home from '../components/home.vue'
import dynamic from '../components/dynamic.vue'
import found from '../components/found.vue'
import my from '../components/my.vue'
import offer from '../components/offer.vue'


import Newslist from '../components/news/newlists.vue'
import NewsInfo from '../components/news/newsInfo.vue'

import sheji from '../components/sheji/zhaosheji.vue'

import Goods from '../components/goods/goods.vue'
import GoodInfo from '../components/goods/goodInfo.vue'
import shopCar from '../components/shopcar/shopcar.vue'

export default new Router({
  routes: [{
      path: '/',
      redirect: '/home',
      name: 'index',
      meta: {
        // 路由层级，数值越大层级越深，以此决定转场动画的前进和后退 大于前进，小于后退
        index: 0,
        showFooter: true,
        keepAlive: false
      }
    },
    {
      path: '/home',
      component: home,
      name: 'home',
      meta: {
        index: 1,
        showFooter: true,
        keepAlive: false
      }
    },
    {
      path: '/dynamic',
      component: dynamic,
      name: 'dynamic',
      meta: {
        index: 1,
        showFooter: true,
        keepAlive: false
      }
    },
    {
      path: '/found',
      component: found,
      name: 'found',
      meta: {
        index: 1,
        showFooter: true,
        keepAlive: false
      }
    },
    {
      path: '/my',
      component: my,
      name: 'my',
      meta: {
        index: 1,
        showFooter: true,
        keepAlive: false
      }
    },
    {
      path: '/offer',
      component: offer,
      name: 'offer',
      meta: {
        index: 1,
        showFooter: true,
        keepAlive: false
      }
    },
    {
      path: '/home/newlists',
      component: Newslist,
      name: 'newlists',
      meta: {
        index: 2,
        showFooter: false,
        keepAlive: true
      }
    },
    {
      path: '/home/newinfo/:dist',
      component: NewsInfo,
      name: 'newinfo',
      meta: {
        index: 2,
        showFooter: false,
        keepAlive: false
      }
    },
    {
      path: '/home/sheji',
      component: sheji,
      name: 'sheji',
      meta: {
        index: 2,
        showFooter: false,
        keepAlive: true
      }
    },
    {
      path: '/home/goods',
      component: Goods,
      name: 'case',
      meta: {
        index: 2,
        showFooter: false,
        keepAlive: true
      }
    },
    {
      path: '/home/goods/goodInfo/:id',
      component: GoodInfo,
      name: 'goodInfo',
      meta: {
        index: 3,
        showFooter: false,
        keepAlive: false
      }
    },
    {
      path: '/home/goods/shopcar',
      component:shopCar,
      name: 'shopCar',
      meta: {
        index: 3,
        showFooter: false,
        keepAlive: false
      }
    }
  ]
})
